package com.ysc.IUDS;

import com.ysc.domain.Teacher;
import com.ysc.utils.mybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class Teacher_Information {

    //展示所有老师的信息
    public static void TeachersShow(){
        SqlSession sqlSession = mybatisUtils.getSqlSession();
        String SqlID= "com.ysc.Dao.TeacherDao.selectAllTeachers";
        List<Teacher> teachers = sqlSession.selectList(SqlID);
        for (Teacher tea : teachers){
            System.out.println(tea);
        }
        sqlSession.close();
    }

    public static int GetOncePrice(int Tid){
        SqlSession sqlSession = mybatisUtils.getSqlSession();
        String SqlId = "com.ysc.Dao.TeacherDao.getOncePrice";
        Teacher teacher = new Teacher();
        teacher.setTid(Tid);
        int price = sqlSession.selectOne(SqlId,Tid);
        sqlSession.close();
        return price;
    }
}
